<include file="Public/header" />
<title>我的桌面</title>
</head>
<body>
<div class="page-container">
    <div class="mt-20">
        <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
            <input type="text" name="name" id="name" value="<{$Think.get.name}>" placeholder=" 单位名称" style="width:250px" class="input-text">
        <button name="" id="search" class="btn btn-success" type="submit"><i class="Hui-iconfont"></i> 搜索</button>
        </span>
            <span class="r">共有数据：<strong><{$count}></strong> 条</span>
        </div>
        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer">
            <table class="table table-border table-bordered table-bg table-hover table-sort dataTable no-footer" id="DataTables_Table_0" role="grid" aria-describedby="DataTables_Table_0_info">
                <thead>
                <tr class="text-c" role="row">
                    <th width="80" class="sorting_desc" tabindex="id" style="width: 120px;">ID</th>
                    <th class="sorting" tabindex="unit_name" style="width: 487px;">名称</th>
                    <th width="120" class="sorting_desc" tabindex="unit_no" style="width: 220px;">编码</th>
                </tr>
                </thead>
                <tbody>
                <foreach name="list" item="data">
                    <tr class="text-c odd" role="row">
                        <td class="sorting_1"><{$data.id}></td>
                        <td class="text-l"><span tabindex="<{$data.id}>" style="width: 90%; padding: 4px 12px; "><{$data.unit_name}></span></td>
                        <td><{$data.unit_no}></td>
                    </tr>
                </foreach>
                </tbody>
            </table>
            <div class="page">
                <{$page}>
            </div>
        </div>
    </div>
    </div>
    <script id="add_text" type="text/html">
        <div style="padding: 12px;">
            <table>
                <tr>
                    <td width="60">单位名称</td>
                    <td><input type="text" class="input-text" /></td>
                </tr>
            </table>
        </div>
    </script>
    <include file="Public/footer" />
    <include file="Public/footer_js" />
    <script>
        $("#search").click(function (){
            search();
        });
       function search(_this){
            var sort,dec;
            if(_this){
                if(_this.attr('class')=='sorting_desc'){
                    sort=_this.attr('tabindex');
                    dec='asc';
                }
                if(_this.attr('class')=='sorting_asc'){
                    sort=_this.attr('tabindex');
                    dec='desc';
                }
                if(_this.attr('class')=='sorting'){
                    sort=_this.attr('tabindex');
                    dec='asc';
                }
            }else{
                sort='';
                dec='';
            }
           var name=$("input[name=name]").val();
            location.href="__ACTION__?name="+name+"&sort="+sort+"&dec="+dec;
        }
        (function(){
            $(".sorting,.sorting_desc,.sorting_asc").click(function (){
                search($(this));
            });
            for(var i=0;i<$(".sorting,.sorting_desc,.sorting_asc").length;i++){
                if('<{$Think.get.sort}>'!=''){
                    if($(".sorting,.sorting_desc,.sorting_asc").eq(i).attr('tabindex')=='<{$Think.get.sort}>'){
                        $(".sorting,.sorting_desc,.sorting_asc").attr('class','sorting');
                        $(".sorting,.sorting_desc,.sorting_asc").eq(i).attr('class','sorting_<{$Think.get.dec}>');
                    }
                }
            }
        })();
    </script>
</body>
</html>